<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">

<head th:fragment="head(title)">

  <!--百度统计-->
  <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?f6089b5b5176e6d8e868f0e4b3cc0168";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>

  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title th:replace="${title}"></title>

  <link rel="icon" type="image/x-icon" th:href="@{images/favicon.ico}" />
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
  <link rel="stylesheet" href="../static/css/typo.css" th:href="@{/css/typo.css}">
  <link rel="stylesheet" href="../static/css/animate.css" th:href="@{/css/animate.css}">
  <link rel="stylesheet" href="../static/lib/prism/prism.css" th:href="@{/lib/prism/prism.css}">
  <link rel="stylesheet" href="../static/lib/tocbot/tocbot.css" th:href="@{/lib/tocbot/tocbot.css}">
  <link rel="stylesheet" href="../static/css/me.css" th:href="@{/css/me.css}">

</head>

<body>

<!--导航-->
<nav th:fragment="menu(n)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small" >
  <div class="ui container">
    <div class="ui inverted secondary stackable menu" style="font-size: 17px">
      <a href="http://www.shaoxiongdu.cn/admin/blogs/" target="_blank" ><h2 class="ui teal header item" th:utext="${session.topTitle}"></h2></a>
      <a href="#" th:href="@{/}" class="m-item item m-mobile-hide " th:classappend="${n==1} ? 'active'">首页</a>
      <a href="#" th:href="@{/types/-1}" class="m-item item m-mobile-hide" th:classappend="${n==2} ? 'active'">分类</a>
      <a href="#" th:href="@{/tags/-1}" class="m-item item m-mobile-hide" th:classappend="${n==3} ? 'active'">标签</a>
      <a href="#" th:href="@{/about}" class="m-item item m-mobile-hide" th:classappend="${n==4} ? 'active'">关于我</a>

      <!--搜索框-->
      <div class="right m-item item m-mobile-hide">
        <form name="search" action="#" th:action="@{/search}" method="post" target="_blank">
          <div class="ui icon inverted transparent input m-margin-tb-tiny">
            <input type="text" name="query" placeholder="搜索...." th:value="${query}">
            <i onclick="document.forms['search'].submit()" class="search link icon"></i>
          </div>
        </form>
      </div>

      <!--github开源地址-->
      <div>
        <a href="https://github.com/shaoxiongdu/blog" target="_blank"  class="right m-item item m-mobile-hide "><i class="icon big github"></i></a>

      </div>


    </div>
  </div>
  <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
    <i class="sidebar icon"></i>
  </a>
</nav>

<!--底部footer-->
<footer th:fragment="footer" class="ui inverted vertical segment m-padded-tb-massive">
  <div class="ui center aligned container">


    <div class="ui inverted divided stackable grid">


      <!--个人说明-->
      <div class="four wide column">
        <h4 class="ui inverted header me-opacity-mini">BLOG</h4>
        <div class="ui inverted list link">
          <p class="item">每个人都有属于自己的一片森林</p>
          <p class="item">也许我们从来不曾去过</p>
          <p class="item">但它一直在那里</p>
          <p class="item">总会在那里</p>
        </div>
      </div>


      <!--推荐博客-->
      <div class="four wide column">
        <h4 class="ui inverted header me-opacity-mini" >最新推荐</h4>
        <div id="newblog-container">
          <div class="ui inverted link list" th:fragment="newblogList">
            <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="item m-text-thin" th:each="blog : ${newblogs}" th:text="${blog.title}"></a>
          </div>
        </div>
      </div>

      <!--联系作者-->
      <div class="four wide column">
        <h4 class="ui inverted header me-opacity-mini">联系博主</h4>
        <div class="ui inverted list link">
          <p>
            <a target="_blank" style="color: #888888" title="添加我的QQ" href="http://wpa.qq.com/msgrd?v=3&uin=740593369&site=qq&menu=yes" >QQ:740593369</a>
          </p>
          <p></p>
          <p class="item">微信:15603430511</p>
          <p>
            <a target="_blank" style="color: #888888" title="我的Github" href="https://github.com/shaoxiongdu" >GitHub:ShaoxiongDu</a>
          </p>
          <p>
            <a target="_blank" style="color: #888888" title="给我发送邮件" href="mailto:email@shaoxiongdu.cn" >邮箱: email@shaoxiongdu.cn</a>
          </p>
        </div>
      </div>

      <!--微信二维码-->
      <div class="four wide column">
        <h4 class="ui inverted header me-opacity-mini" >我的个人微信</h4>
        <div class="ui inverted link list">

          <a class="item" href="#" th:href="@{/about}"><img th:src="@{/images/wechat.jpg}" alt="15603430511" title="15603430511"   class="ui rounded image"  style="width: 110px"></a>

        </div>
      </div>

    </div>

    <div class="ui inverted section divider"></div>

    <!--ICP备案号-->
    <div class="ui inverted list link">
      <p style="color: #AAAAAA;font-size: 17px" >程序员不是天生的 | 2021 版权所有 @ 杜少雄 保留所有权利<a style="color:#AAAAAA;" target="_blank" href='https://beian.miit.gov.cn/'>&nbsp;&nbsp;&nbsp;晋ICP备2020012997号-2</a> <p>


      <!--访问量数据-->
      <p class="item">访问量 : <span th:text="${session.views}"></span> &nbsp;&nbsp;&nbsp; 勉强运行 : <span id="htmer_time" class="item m-text-thin"></span> &nbsp;&nbsp;&nbsp; </p>
    </div>
  </div>

</footer>

<th:block th:fragment="script">
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
  <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/jquery.scrollto@2.1.2/jquery.scrollTo.min.js"></script>
  <script src="../static/lib/prism/prism.js" th:src="@{/lib/prism/prism.js}"></script>
  <script src="../static/lib/tocbot/tocbot.min.js" th:src="@{/lib/tocbot/tocbot.min.js}"></script>
  <script src="../static/lib/qrcode/qrcode.min.js" th:src="@{/lib/qrcode/qrcode.min.js}"></script>
  <script src="../static/lib/waypoints/jquery.waypoints.min.js" th:src="@{/lib/waypoints/jquery.waypoints.min.js}"></script>
  <script>
    $('#newblog-container').load(/*[[@{/footer/newblog}]]*/"/footer/newblog");


    // 运行时间统计
    function secondToDate(second) {
      if (!second) {
        return 0;
      }
      var time = new Array(0, 0, 0, 0, 0);
      if (second >= 365 * 24 * 3600) {
        time[0] = parseInt(second / (365 * 24 * 3600));
        second %= 365 * 24 * 3600;
      }
      if (second >= 24 * 3600) {
        time[1] = parseInt(second / (24 * 3600));
        second %= 24 * 3600;
      }
      if (second >= 3600) {
        time[2] = parseInt(second / 3600);
        second %= 3600;
      }
      if (second >= 60) {
        time[3] = parseInt(second / 60);
        second %= 60;
      }
      if (second > 0) {
        time[4] = second;
      }
      return time;
    }

    /*网站建站日期*/
    function setTime() {
      /*此处为网站的创建时间*/
      var create_time = Math.round(new Date(Date.UTC(2020, 12, 10, 15, 15, 15)).getTime() / 1000);
      var timestamp = Math.round((new Date().getTime() + 8 * 60 * 60 * 1000) / 1000);
      currentTime = secondToDate((timestamp - create_time));
      currentTimeHtml = currentTime[0] + '年' + currentTime[1] + '天'
              + currentTime[2] + '时' + currentTime[3] + '分' + currentTime[4]
              + '秒';
      document.getElementById("htmer_time").innerHTML = currentTimeHtml;
    }
    setInterval(setTime, 1000);

  </script>

</th:block>

</body>
</html>